package wsi.input;

import org.rygh.semantic.gui.swing.input.Input;

public class InputCandidate {
	private final Input input;
	private final String xml;
	private Boolean valid = null;

	public InputCandidate(Input input, String xml) {
		this.input = input;
		this.xml = xml;
	}

	public Input getInput() {
		return input;
	}

	public String getXml() {
		return xml;
	}

	public boolean isInvalid() {
		return valid == Boolean.FALSE;
	}

	public boolean isUnknown() {
		return valid == null;
	}

	public boolean isValid() {
		return valid == Boolean.TRUE;
	}

	public void setValid(boolean valid) {
		this.valid = valid;
	}

	public boolean xmlEqualsTo(Object o) {
		return xml.equals(((InputCandidate) o).xml);
	}

}
